package com.zetor.ms.core.enums;

public enum ResultState {
	SUCCESS("成功", 1),
	FAIL("失败", -1),
	WARN("警告", 0);
	private String name;
	private int key;
	private ResultState(String name, int key) {
		this.name = name;
		this.key = key;
	}
	public static String getNameByKey(int key) {
		for(ResultState state : ResultState.values()) {
			if(state.getKey() == key) {
				return state.getName();
			}
		}
		return "";
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getKey() {
		return key;
	}
	public void setKey(int key) {
		this.key = key;
	}
}
